export default {
  namespace: 'user', // 注意定义namespace, 将会在store中存储
  state: {
    userId: ''
  },
  getters: {
    userId: state => state.userId
  },
  actions: {
    updateUserInfo ({commit, state}, payload) {
      commit('updateUserInfo', payload)
    }
  },
  mutations: {
    updateUserInfo (state, payload) {
      for (let prop in payload) {
        state[prop] = payload[prop]
      }
    }
  }
}
